//
//  SCNNode+HKRuler.m
//  HKOCRuler
//
//  Created by lbxia on 2018/11/24.
//  Copyright © 2018年 lbx. All rights reserved.
//

#import "SCNNode+HKRuler.h"

@implementation SCNNode (HKRuler)

- (void)setUniformScale:(CGFloat)scale
{
    self.scale = SCNVector3Make(scale, scale, scale);
}

- (void)renderOnTop
{
    self.renderingOrder = 2;
    if (self.geometry)
    {
        for (SCNMaterial *material in self.geometry.materials) {
            
            material.readsFromDepthBuffer = NO;
        }
    }
    
    for (SCNNode *child in self.childNodes) {
        [child renderOnTop];
    }
}

@end
